from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Roles,Menu,RolesUser,Permission

class RolesSerializers(serializers.ModelSerializer):
    # user = UserSerializers()
    class Meta:
        model= Roles
        fields="__all__"

class UserSerializers(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = "__all__"

class MenuSerializers(serializers.ModelSerializer):
    # user = UserSerializers()
    class Meta:
        model= Menu
        fields="__all__"

class RolesUserSerializers(serializers.ModelSerializer):
    # user = UserSerializers()
    class Meta:
        model= RolesUser
        fields="__all__"
        depth = 2

class PermissionSerializers(serializers.ModelSerializer):

    class Meta:
        model= Permission
        fields="__all__"